<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<style type="text/css">
<!--
.STYLE1 {
	font-size: 12px
}

.STYLE3 {
	color: #707070;
	font-size: 12px;
}

.STYLE5 {
	color: #0a6e0c;
	font-size: 12px;
}

.STYLE7 {
	font-size: 12
}
-->
</style>
<script language="javascript">
	function checkForm() {
		var arr1 = document.getElementsByName("item1Score");
		var arr2 = document.getElementsByName("item2Score");
		var arr3 = document.getElementsByName("item3Score");
		var arr4 = document.getElementsByName("item4Score");
		var arr5 = document.getElementsByName("item5Score");
		var arr6 = document.getElementsByName("item6Score");
		var arr7 = document.getElementsByName("item7Score");
		var arr8 = document.getElementsByName("item8Score");
		var arr9 = document.getElementsByName("item9Score");
		var arr10 = document.getElementsByName("item10Score");
		var arr11 = document.getElementsByName("item11Score");
		var arr12 = document.getElementsByName("item12Score");
		var arr13 = document.getElementsByName("item13Score");
		var arr14 = document.getElementsByName("item14Score");
		var arr15 = document.getElementsByName("item15Score");
		var arr16 = document.getElementsByName("item16Score");
		var arr17 = document.getElementsByName("item17Score");
		var arr18 = document.getElementsByName("item18Score");
		var arr19 = document.getElementsByName("item19Score");
		var arr20 = document.getElementsByName("item20Score");
		var suggestion = document.getElementById("suggestion").value;
		
		var v1="";
		var v2="";
		var v3="";
		var v4="";
		var v5="";
		var v6="";
		var v7="";
		var v8="";
		var v9="";
		var v10="";
		var v11="";
		var v12="";
		var v13="";
		var v14="";
		var v15="";
		var v16="";
		var v17="";
		var v18="";
		var v19="";
		var v20="";
		
		   for(var i=0;i<arr1.length;i++){
		       if(arr1[i].checked) {
		    v1 = arr1[i].value;break;
		       }
		    }
		   for(var i=0;i<arr2.length;i++){
		       if(arr2[i].checked) {
		    v2 = arr2[i].value;break;
		       }
		    }
		   for(var i=0;i<arr3.length;i++){
		       if(arr3[i].checked) {
		    v3 = arr3[i].value;break;
		       }
		    }
		   for(var i=0;i<arr4.length;i++){
		       if(arr4[i].checked) {
		    v4 = arr4[i].value;break;
		       }
		    }
		   for(var i=0;i<arr5.length;i++){
		       if(arr5[i].checked) {
		    v5 = arr5[i].value;break;
		       }
		    }
		   for(var i=0;i<arr6.length;i++){
		       if(arr6[i].checked) {
		    v6 = arr6[i].value;break;
		       }
		    }
		   for(var i=0;i<arr7.length;i++){
		       if(arr7[i].checked) {
		    v7 = arr7[i].value;break;
		       }
		    }
		   for(var i=0;i<arr8.length;i++){
		       if(arr8[i].checked) {
		    v8 = arr8[i].value;break;
		       }
		    }
		   for(var i=0;i<arr9.length;i++){
		       if(arr9[i].checked) {
		    v9 = arr9[i].value;break;
		       }
		    }
		   for(var i=0;i<arr10.length;i++){
		       if(arr10[i].checked) {
		    v10 = arr10[i].value;break;
		       }
		    }
		   for(var i=0;i<arr11.length;i++){
		       if(arr11[i].checked) {
		    v11 = arr11[i].value;break;
		       }
		    }
		   for(var i=0;i<arr12.length;i++){
		       if(arr12[i].checked) {
		    v12 = arr12[i].value;break;
		       }
		    }
		   for(var i=0;i<arr13.length;i++){
		       if(arr13[i].checked) {
		    v13 = arr13[i].value;break;
		       }
		    }
		   for(var i=0;i<arr14.length;i++){
		       if(arr14[i].checked) {
		    v14 = arr14[i].value;break;
		       }
		    }
		   for(var i=0;i<arr15.length;i++){
		       if(arr15[i].checked) {
		    v15 = arr15[i].value;break;
		       }
		    }
		   for(var i=0;i<arr16.length;i++){
		       if(arr16[i].checked) {
		    v16 = arr16[i].value;break;
		       }
		    }
		   for(var i=0;i<arr17.length;i++){
		       if(arr17[i].checked) {
		    v17 = arr17[i].value;break;
		       }
		    }
		   for(var i=0;i<arr18.length;i++){
		       if(arr18[i].checked) {
		    v18 = arr18[i].value;break;
		       }
		    }
		   for(var i=0;i<arr19.length;i++){
		       if(arr19[i].checked) {
		    v19 = arr19[i].value;break;
		       }
		    }
		   for(var i=0;i<arr20.length;i++){
		       if(arr20[i].checked) {
		    v20 = arr20[i].value;break;
		       }
		    }
		if(v1==""){
		   alert("第一个单选按钮没有选择！");
		   return false;
		}
		if(v2==""){
			   alert("第二个单选按钮没有选择！");
			   return false;
		}
		if(v3==""){
			   alert("第三个单选按钮没有选择！");
			   return false;
			}
		if(v4==""){
			   alert("第四个单选按钮没有选择！");
			   return false;
			}
		if(v5==""){
			   alert("第五个单选按钮没有选择！");
			   return false;
			}
		if(v6==""){
			   alert("第六个单选按钮没有选择！");
			   return false;
			}
		if(v7==""){
			   alert("第七个单选按钮没有选择！");
			   return false;
			}
		if(v8==""){
			   alert("第八个单选按钮没有选择！");
			   return false;
			}
		if(v9==""){
			   alert("第九个单选按钮没有选择！");
			   return false;
			}
		if(v10==""){
			   alert("第十个单选按钮没有选择！");
			   return false;
			}
		if(v11==""){
			   alert("第十一个单选按钮没有选择！");
			   return false;
			}
		if(v12==""){
			   alert("第十二个单选按钮没有选择！");
			   return false;
			}
		if(v13==""){
			   alert("第十三个单选按钮没有选择！");
			   return false;
			}
		if(v14==""){
			   alert("第十四单选按钮没有选择！");
			   return false;
			}
		if(v15==""){
			   alert("第十五个单选按钮没有选择！");
			   return false;
			}
		if(v16==""){
			   alert("第十六个单选按钮没有选择！");
			   return false;
			}
		if(v17==""){
			   alert("第十七个单选按钮没有选择！");
			   return false;
			}
		if(v18==""){
			   alert("第十八个单选按钮没有选择！");
			   return false;
			}
		if(v19==""){
			   alert("第十九个单选按钮没有选择！");
			   return false;
			}
		if(v20==""){
			   alert("第二十个单选按钮没有选择！");
			   return false;
			}
		if (suggestion == null || suggestion == "") {
			alert("请输入教学建议！");
			return false;
		}

	}
</script>

<h3>${criteria.name }<font color="red">${EvalTimeError }${EvalExistError }${EvalTimeNotSet }${FormRadioSelectError }${FormSuggestionInputError }</font></h3>
<html:form action="courseEvaluate.do?method=evaluateSave" method="post" onsubmit="return checkForm();">
<html:hidden property="evaluatorId" value="${student.id}"/>
<html:hidden property="evaluatedId" value="${teacher.id}"/>
<html:hidden property="courseId" value="${course.id}"/>
<html:hidden property="clazzId" value="${student.clazz.id}"/>
<html:hidden property="criteriaId" value="${criteria.id}"/>
<table width="800" border="1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="80" height="30" align="center" bgcolor="#CCCCCC"><strong>教师</strong></td>
		<td width="120" align="center">${teacher.nickname }</td>
		<td width="80" align="center" bgcolor="#CCCCCC"><strong>班级</strong></td>
		<td width="120" align="center">${student.clazz.clazzName }</td>
		<td width="80" align="center" bgcolor="#CCCCCC"><strong>课程</strong></td>
		<td width="120" align="center">${course.courseName }</td>
		<td width="80" align="center" bgcolor="#CCCCCC"><strong>时间</strong></td>
		<td align="center">${time }</td>
	</tr>
</table>
<br />
<table width="800" border="1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100" height="50" align="center" rowspan="2" bgcolor="#CCCCCC"><strong>评价项目</strong></td>
		<td width="420" rowspan="2" align="center" bgcolor="#CCCCCC"><strong>指 标 内 容</strong></td>
		<td width="60" rowspan="2" align="center" bgcolor="#CCCCCC"><strong>权 重</strong></td>
		<td width="152" colspan="4" align="center" bgcolor="#CCCCCC"><strong>等	级</strong></td>
	</tr>
	<tr>
		<td width="38" align="center" bgcolor="#CCCCCC"><strong>优</strong></td>
		<td width="38" align="center" bgcolor="#CCCCCC"><strong>良</strong></td>
		<td width="38" align="center" bgcolor="#CCCCCC"><strong>中</strong></td>
		<td width="38" align="center" bgcolor="#CCCCCC"><strong>差</strong></td>
	</tr>

	<c:if test="${!empty itemList}">
		<c:forEach items="${itemList}" var="item" varStatus="i">
			<tr>
				<td height="30" align="center" valign="middle">${item.category.name }</td>
				<td height="30" align="left" valign="middle">${item.content }</td>
			    <td height="30" align="center" valign="middle">${item.proportion }</td>
				<td height="30" align="center"><html:radio property="item${i.index + 1 }Score" value="10" /></td>
				<td height="30" align="center"><html:radio property="item${i.index + 1 }Score" value="8" /></td>
				<td height="30" align="center"><html:radio property="item${i.index + 1 }Score" value="6" /></td>
				<td height="30" align="center"><html:radio property="item${i.index + 1 }Score" value="4" /></td>
			</tr>
		</c:forEach>
	</c:if>
</table>
<br/>


<br/>
<table width="800" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="800" height="25" bgcolor="#CCCCCC"><strong>教学建议：</strong></td>
</tr>
<tr>
  <td><p>
    <html:textarea property="suggestion" cols="97" rows="5" />
  </p>
    </td>
</tr>
</table>
<br/>
<p>
  <html:submit value="提交" style="width:80px" />&nbsp;&nbsp;<html:reset value="重置" style="width:80px" />
</p>
</html:form>